import { App } from 'vue'
import { ControlType, registerControlProvider } from '@ibiz-template/runtime'

import { CaptionBarProvider } from './caption-bar/i-biz-caption-bar-control.provider'
import { ListProvider } from './list/list/i-biz-list-control.provider'
import { MDCtrlProvider } from './list/md-ctrl/i-biz-md-ctrl-control.provider'
import { SearchBarProvider } from './search-bar/i-biz-search-bar-control.provider'
import { ToolbarProvider } from './toolbar/i-biz-toolbar-control.provider'
import { ViewLayoutPanelProvider } from './view-layout-panel/i-biz-view-layout-panel.provider'

export const ControlComponentRegister = {
  install(v: App) {
    // 视图布局面板部件
    registerControlProvider(ControlType.VIEW_LAYOUT_PANEL, () => new ViewLayoutPanelProvider())
    // 标题栏
    registerControlProvider(ControlType.CAPTIONBAR, () => new CaptionBarProvider())
    // 列表
    registerControlProvider(ControlType.LIST, () => new ListProvider())
    // 多数据部件
    registerControlProvider(ControlType.MOB_MDCTRL, () => new MDCtrlProvider())
    // 搜索栏
    registerControlProvider(ControlType.SEARCHBAR, () => new SearchBarProvider())
    // 工具栏部件
    registerControlProvider(ControlType.TOOLBAR, () => new ToolbarProvider())
  },
}
